package io.gitee.zhangbinhub.admin.log.repo

import io.gitee.zhangbinhub.admin.log.base.BaseRepository
import io.gitee.zhangbinhub.admin.log.entity.OperateLogHistory
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param

/**
 * @since JDK 11
 */
interface OperateLogHistoryRepository : BaseRepository<OperateLogHistory, String> {
    @Modifying(flushAutomatically = true, clearAutomatically = true)
    @Query("delete from OperateLogHistory where requestTime<:time")
    fun deleteAllByRequestTimeLessThan(@Param("time") time: Long)
}
